package com.sixth.controller;

import com.sixth.entity.CourseVo;
import com.sixth.entity.ECourse;

import com.sixth.entity.TableResult;
import com.sixth.entity.Zone;
import com.sixth.service.EcourService;
import com.sixth.until.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: self-tui-education
 * @description:
 * @author: C
 * @create: 2022-04-27 00:02
 **/
@RestController
@RequestMapping("/home/zone-course")
public class EduController {
@Autowired
    private EcourService ecourService;
//课程专区查询
    @PostMapping("/getAllDetail/{currentPage}/{pageSize}")
    private TableResult selectAllTeacher(@PathVariable Integer currentPage, @PathVariable Integer pageSize, @RequestBody ECourse eduCourse) {
        return ecourService.selectAlleduCourse(currentPage,pageSize,eduCourse);
    }
    //课程专区查询添加
    @PostMapping("/findCourse/{pageCurrent}/{pageSize}")
    private TableResult selectAllTeachera(@PathVariable Integer pageCurrent, @PathVariable Integer pageSize, @RequestBody ECourse eduCourse) {
        return ecourService.selectAlleduCoursee(pageCurrent,pageSize,eduCourse);
    }
    //课程专区删除
    @PostMapping("/deleteZoneCourse")
    public CommonResult delete(@RequestBody ECourse eCourse) {
        return ecourService.deleteFindById(eCourse);
    }

    //修改图片状态
    @PostMapping("/addCourseDetail")
    public CommonResult addCourseDetail(@RequestBody CourseVo courseVo) {
        return ecourService.addCourseDetail(courseVo);
    }
}
